package org.langke.leetcode;

import java.util.Arrays;

/**
 * Created by lee on 2020/6/7.
 */
public class TwoNumSum {
    public int[] towNumSum(int num[],int target){
        int res[]=null;
        for(int i=0; i<num.length - 1 ; i++){
            for(int j=i+1;j<num.length;j++){
                if(num[i]+num[j]==target){
                    res = new int[]{i,j};
                    return res;
                }
            }
        }
        return res;
    }
    public static void main(String[] args){
        int num[] = {2,7,11,15};
        int target = 9;
        int res[] = new TwoNumSum().towNumSum(num,target);
        System.out.println(Arrays.toString(res));
    }
}
